
<?php include_once './application/views/sys_admin/common/header.php';  ?>
<!-- admin_main -->
<div class=" definewidth m20">
	<form  method="post" id="forumForm" name="forumForm"  enctype="multipart/form-data">
		<input type="hidden"  name="act" id="act" value="edit"/>
		<input type="hidden"  name="id" id="id" value="<?php echo $forum['id'];?>"/>
		<table class="table table-bordered table-hover m10">
		 <tr>
	        <td class="tableleft">主题</td>
	        <td>
	        	<select id="tid" name="tid">
					<option value="0">--请选择主题--</option>
					<?php foreach($forum_theme as $tk=>$tv){?>
						<option value="<?php echo $tk;?>"  <?php if($forum['tid'] == $tk){echo 'selected';}?>><?php echo $tv;?></option>
					<?php }?>
				</select>	
			</td>
	   	</tr>
	   	<tr>
	        <td class="tableleft">用户名</td>
	        <td><input type="text" name="author" id="author" size="50" value="<?php echo $forum['author'];?>" /> </td>
	   	</tr>
	   	<tr>
	        <td class="tableleft">标题</td>
	        <td><input type="text" name="subject" id="subject" size="50"  value="<?php echo $forum['subject'];?>" /></td>
	   	</tr>
	   	<tr>
	        <td class="tableleft">帖子标签</td>
	        <td><textarea name="tags" id="tags" rows="5" cols="50"><?php echo $forum['tags'];?></textarea></td>
	   	</tr>
	   	<tr>
	        <td class="tableleft">帖子状态</td>
	        <td>
	        <?php foreach($forum_status as $k=>$v){?>
				<input type="radio" name="fstatus" value="<?php echo $k;?>" <?php if ($forum['fstatus']==$k) echo "checked='checked'"; ?>/><?php echo $v;?> 
			<?php }?>
			</td>
	   	</tr>
	   	<tr>
	        <td class="tableleft">帖子内容</td>
	        <td>
	        <script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
    				<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.js"></script>
    				<script type="text/javascript" charset="utf-8">
		          var editor = new baidu.editor.ui.Editor();
		          editor.render('content');  //editor为编辑器容器的id
		      </script>
			<textarea name="content" id="content" style="width:800px"><?php echo $forum['content'];?></textarea>
	        </td>
	   	</tr>
	   	<tr>
	        <td class="tableleft"></td>
	        <td> </td>
	   	</tr>
	   	<tr>
	        <td class="tableleft"></td>
	        <td> <button type="button" class="btn btn-success"  onclick="forumSubmit();" >提交</button> </td>
	   	</tr>
	   </table>
	</form>
</div>
<script type="text/javascript">
function forumSubmit(){
	var options = {
		url : '/sys_admin/forum/invitation_save/',
		dataType: "json",
		type:"post",
		success : function(ret) {
			if(ret.msg>0){
				alert("操作成功");
				window.location.href ='/sys_admin/forum/invitation_list';
			}else{
				alert(ret.msg);
			}
			
		}
	};
	$("#forumForm").ajaxSubmit(options);
	return false;
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
